/**
 * @file Home/mobile.css
 * @description 首页移动端样式
 * @copyright 版权所有 (c) 2025 UIED技术团队
 * @website https://fsuied.com
 * @license MIT
 * @version 1.0.0
 */

/* 移动端专用样式文件 - 新Home页面布局 */
/* 使用媒体查询在750px以下应用移动端样式 */

@media (max-width: 750px) {
  /* 移动端全局容器 */
  .home-page {
    font-size: 14px;
    line-height: 1.4;
  }

  /* ===== 移动端主布局 - 统一1rem间距 ===== */
  .home-main-content {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem; /* 统一所有方向1rem间距 */
    margin: 0;
    min-height: calc(100vh - 56px);
    width: 100%;
    box-sizing: border-box;
  }

  /* ===== 移动端Banner区域 ===== */
  .home-banner-section {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    order: 1;
  }

  .banner-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    background: linear-gradient(135deg, #FF6B00 0%, #FF913E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  /* 移动端轮播图 */
  .carousel-container {
    height: 200px;
    border-radius: 0.5rem;
  }

  .carousel-slide {
    padding: 1rem;
  }

  .slide-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
  }

  .slide-subtitle {
    font-size: 0.75rem;
    margin: 0 0 0.5rem 0;
    opacity: 0.9;
    line-height: 1.4;
  }

  .slide-description {
    font-size: 0.6875rem;
    margin: 0 0 0.5rem 0;
    opacity: 0.8;
    line-height: 1.4;
  }

  .slide-tags {
    gap: 0.25rem;
    margin-bottom: 0.75rem;
  }

  .slide-tag {
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
    border-radius: 0.75rem;
  }

  .slide-action .ui-button {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.75rem !important;
    border-radius: 0.375rem !important;
  }

  /* 轮播图指示器移动端优化 */
  .carousel-indicators {
    bottom: 0.75rem;
  }

  .carousel-indicators .indicator {
    width: 0.5rem;
    height: 0.5rem;
  }

  /* ===== 移动端文章区域 ===== */
  .home-articles-section {
    background: var(--white);
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    order: 2;
  }

  .articles-header {
    margin-bottom: 1rem;
  }

  .articles-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    background: linear-gradient(135deg, #FF6B00 0%, #FF913E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .articles-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
  }

  /* 移动端文章列表 */
  .articles-list {
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 300px;
    padding-right: 0.25rem;
  }

  .article-item {
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
  }

  .article-rank {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    margin-top: 0;
  }

  .article-title {
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0 0 0.375rem 0;
    line-height: 1.3;
    -webkit-line-clamp: 2;
  }

  .article-meta {
    gap: 0.5rem;
    font-size: 0.625rem;
    flex-wrap: wrap;
  }

  .article-category {
    padding: 0.0625rem 0.375rem;
    font-size: 0.5625rem;
    border-radius: 0.5rem;
  }

  /* 移动端查看更多按钮 */
  .articles-footer {
    text-align: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
  }

  .view-more-btn {
    background: linear-gradient(135deg, #FF6B00 0%, #FF913E 100%) !important;
    border: none !important;
    border-radius: 0.375rem !important;
    padding: 0.5rem 1rem !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    transition: all 0.3s ease !important;
    min-height: 44px; /* 触摸友好 */
  }

  .view-more-btn:hover {
    transform: translateY(-0.0625rem) !important;
    opacity: 0.9 !important;
  }
}

/* ===== 小屏幕设备优化 (iPhone SE等) ===== */
@media (max-width: 375px) {
  .home-main-content {
    padding: 0.75rem;
  }

  .home-banner-section,
  .home-articles-section {
    padding: 0.75rem;
  }

  .banner-title,
  .articles-title {
    font-size: 1rem;
  }

  .carousel-container {
    height: 160px;
  }

  .slide-title {
    font-size: 0.875rem;
  }

  .slide-subtitle {
    font-size: 0.6875rem;
  }

  .slide-description {
    font-size: 0.625rem;
  }

  .article-item {
    padding: 0.5rem;
  }

  .article-rank {
    width: 1.25rem;
    height: 1.25rem;
    font-size: 0.5625rem;
  }

  .article-title {
    font-size: 0.6875rem;
  }
}

/* ===== 横屏优化 ===== */
@media (max-width: 750px) and (max-height: 500px) and (orientation: landscape) {
  .home-main-content {
    flex-direction: row;
    gap: 1rem;
    padding: 0.75rem;
  }

  .home-banner-section,
  .home-articles-section {
    flex: 1;
    padding: 1rem;
  }

  .carousel-container {
    height: 150px;
  }

  .articles-list {
    max-height: 200px;
  }
}

/* ===== 深色模式适配 ===== */

/* ===== 触摸设备优化 ===== */
@media (max-width: 750px) {
  /* 增加触摸目标尺寸 */
  .home-page * {
    -webkit-tap-highlight-color: transparent;
  }

  .article-item,
  .carousel-slide,
  .carousel-indicators .indicator,
  .view-more-btn {
    min-height: 44px; /* iOS触摸目标最小尺寸 */
  }

  /* 优化触摸反馈 */
  .home-page input,
  .home-page button,
  .article-item,
  .carousel-slide {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  /* 允许文本选择 */
  .article-title,
  .slide-title,
  .slide-subtitle,
  .slide-description {
    -webkit-user-select: text;
    user-select: text;
  }

  /* 整体性能优化 */
  .home-page {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  /* 滚动优化 */
  .articles-list {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
}

/**
 * Home页面移动端样式 - 参考AIBase设计
 * 适配轮播图和简化的文章列表布局
 * 使用rem单位，优化移动端体验
 */

/* 移动端特定样式 */
@media (max-width: 768px) {
  .home-container {
    padding: 0;
  }

  /* 顶部区域在移动端垂直排列 */
  .home-top-section {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
  }

  /* 轮播图区域 */
  .home-carousel-section {
    width: 100%;
    margin-bottom: 0;
  }

  .carousel-container {
    height: 12rem;
  }

  .slide-content {
    padding: 1rem;
  }

  .slide-title {
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
  }

  .slide-subtitle {
    font-size: 0.75rem;
    line-height: 1.4;
  }

  /* 排行榜区域 */
  .home-ranking-section {
    width: 100%;
    margin-top: 0;
  }

  .ranking-title {
    font-size: 1.125rem;
    margin-bottom: 1rem;
  }

  .ranking-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
  }

  .rank-number-container {
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.75rem;
  }

  .rank-number {
    font-size: 0.75rem;
  }

  .ranking-item-title {
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
  }

  .ranking-item-meta {
    gap: 1rem;
  }

  .ranking-item-views,
  .ranking-item-score {
    font-size: 0.75rem;
  }

  /* Banner区域 */
  .home-banner-section {
    margin-top: 1.5rem;
    padding: 0 1rem;
  }

  /* 设计文章区域 */
  .home-design-section {
    margin-top: 2rem;
    padding: 0 1rem;
  }

  .home-design-section .section-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  /* 子分类标签在移动端的样式 */
  .home-design-section .subcategory-tabs {
    margin-bottom: 1.5rem;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .home-design-section .subcategory-tab {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    margin-right: 0.5rem;
    font-size: 0.8125rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* 文章网格在移动端改为2列 */
  .home-design-section .article-grid,
  .home-design-section .articles-grid,
  .home-design-section .skeleton-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .home-design-section .article-card {
    border-radius: 0.5rem;
  }

  .home-design-section .article-image-container {
    height: 8rem;
  }

  .home-design-section .article-content {
    padding: 0.75rem;
  }

  .home-design-section .article-title {
    font-size: 0.8125rem;
    gap: 0.375rem;
  }

  .home-design-section .article-rank {
    min-width: 1.75rem;
    height: 1.125rem;
    font-size: 0.6875rem;
    border-radius: 0.625rem;
  }

  /* 查看更多按钮 */
  .home-design-section .view-more-btn {
    display: none;
  }

  .home-design-section .mobile-view-more {
    display: block;
    margin-top: 1.5rem;
    text-align: center;
  }

  .home-design-section .mobile-view-more-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--border-radius-small);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition-normal);
  }

  .home-design-section .mobile-view-more-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-0.125rem);
  }

  /* 加载状态优化 */
  .home-design-section .skeleton-grid .article-card {
    height: auto;
  }

  .home-design-section .skeleton-image {
    height: 8rem;
  }

  .home-design-section .skeleton-content {
    padding: 0.75rem;
  }

  /* 错误状态优化 */
  .home-design-section .empty-container {
    padding: 2rem 1rem;
  }

  .home-design-section .retry-button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
  .home-top-section {
    padding: 0.75rem;
    gap: 1rem;
  }

  .carousel-container {
    height: 10rem;
  }

  .slide-title {
    font-size: 0.9375rem;
  }

  .slide-subtitle {
    font-size: 0.6875rem;
  }

  .ranking-title {
    font-size: 1rem;
  }

  .ranking-item-title {
    font-size: 0.8125rem;
  }

  .home-design-section {
    padding: 0 0.75rem;
  }

  .home-design-section .section-title {
    font-size: 1.125rem;
  }

  /* 超小屏幕下文章网格改为单列 */
  .home-design-section .article-grid,
  .home-design-section .articles-grid,
  .home-design-section .skeleton-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .home-design-section .article-image-container {
    height: 10rem;
  }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
  .home-container {
    padding: 0.5rem 0;
  }

  .home-carousel-section {
    margin-bottom: 1rem;
  }

  .carousel-container {
    height: 5rem;
  }

  .home-main-content {
    gap: 1rem;
  }

  .articles-list {
    max-height: 15rem;
  }

  .articles-title {
    font-size: 1rem;
  }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
  .article-item {
    /* 增加触摸目标大小 */
    min-height: 2.75rem;
  }

  .article-item:active {
    background: var(--background-gray);
    transform: scale(0.98);
    transition: var(--transition-fast);
  }

  .retry-button:active {
    transform: scale(0.95);
  }

  .carousel-slide:active {
    transform: scale(0.98);
  }

  .carousel-indicators .indicator:active {
    transform: scale(1.3);
  }

  /* 移除所有hover效果 */
  .article-item:hover,
  .retry-button:hover,
  .carousel-indicators .indicator:hover {
    transform: none;
    box-shadow: none;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .article-item {
    border-bottom-width: 0.125rem;
  }

  .article-item.hot {
    border-left: 0.1875rem solid var(--primary-color);
  }

  .rank-number.top-three {
    border: 0.125rem solid var(--primary-color);
  }

  .carousel-container {
    border: 0.125rem solid var(--border-medium);
  }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
  .carousel-slide {
    transition: none;
  }

  .loading-spinner {
    animation: none;
    border: 0.1875rem solid var(--primary-color);
  }

  .article-item,
  .retry-button,
  .carousel-indicators .indicator {
    transition: none;
  }

  .carousel-indicators .indicator.active {
    transform: none;
  }
} 